/**
 * 2018年12月17日下午3:36:25
 * @author 谢进财
 */
package com.baihang.project.ds.dao;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.baihang.framework.dao.BaseDao;
import com.baihang.project.ds.model.FangYuanModel;
import com.baihang.project.ds.model.dbMap.FangYuanRowMapper;

@Repository
public class FangYuanDao extends BaseDao {
	private static Logger logger = LoggerFactory.getLogger(FangYuanDao.class);
	@Autowired
	private FangYuanRowMapper rowMapper;
	
	public List<FangYuanModel> queryForFangYuanList(String sql){
		logger.info(sql);
		List<FangYuanModel>  modelList = null;
		try {
			modelList = super.getJdbcTemplate().query(sql, rowMapper);
		}catch (Exception e) {
			logger.info("查询词源模型失败");
		}
		return modelList;
	}
	
	public FangYuanModel queryForFangYuan(String sql) {
		FangYuanModel model =null;
		try {
			model = super.getJdbcTemplate().queryForObject(sql, rowMapper);
		}catch (Exception e) {
			// TODO: handle exception
		}
		return model;
	}
}
